import service from '@/service/axios.js'
import {ElMessage} from 'element-plus'
import {baseStore} from "@/store/baseStore.js";
import i18n from '@/language/index'


export const api = service
export const bs = baseStore
export const t = i18n.global.t
export const message = ElMessage


/**
 * 防抖
 * 使用 stabilization(() => {console.log(11)}, 1500)
 */
export function stabilization() {
    let timer = null
    return (callback, time = 800) => {
        timer && clearTimeout(timer)
        timer = setTimeout(callback, time)
    }
}